home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / tests / unittests / utiltests.pyo (.txt) < prev   
Python Compiled Bytecode  |  2008-10-13  |  2KB  |  49 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import unittest
  5. import util
  6. import struct
  7.  
  8. class UtilTestingSuite(unittest.TestCase):
  9.     
  10.     def testUnpackNames(self):
  11.         testdata = struct.pack('!HIB', 1, 0xFA0L, 3) + 'some extraneous data'
  12.         magic_hash = util.unpack_named('!HIBR', 'one', 'four thousand long', 'three', 'extra', testdata)
  13.         self.assertEquals(magic_hash['extra'], 'some extraneous data')
  14.  
  15.     
  16.     def testStorage(self):
  17.         s = util.Storage({
  18.             'key': 'value' })
  19.         self.assertEquals(s.key, 'value')
  20.  
  21.     
  22.     def testdocs(self):
  23.         import doctest as doctest
  24.         doctest.testmod(util)
  25.  
  26.     
  27.     def testBaseClasses(self):
  28.         
  29.         class Shape(object):
  30.             pass
  31.  
  32.         
  33.         class Rectangle(Shape):
  34.             pass
  35.  
  36.         
  37.         class Square(Rectangle):
  38.             pass
  39.  
  40.         self.assertEqual(set(util.baseclasses(Square)), set([
  41.             Rectangle,
  42.             Shape,
  43.             object]))
  44.  
  45.  
  46. if __name__ == '__main__':
  47.     unittest.main()
  48.  
  49.